'use strict'

let fs =require('fs')
let Promise = require('bluebird')

exports.readFileAsync = function(fpath, encoding){
    return new Promise((resovle, reject) => {
        fs.readFile(fpath, encoding, function(err, content){
            if(err) reject(err)

            else resovle(content)
        })
    })
}

exports.writeFileAsync = function(fpath, content){
    return new Promise((resovle, reject) => {
        fs.writeFile(fpath, content, function(err){
            if(err) reject(err)

            else resovle()
        })
    })
}